package com.ruoyi.web.controller.common;

import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.web.domain.user.UserInfo;
import com.ruoyi.web.service.Impl.UserServiceImpl;
import org.apache.commons.lang3.concurrent.ConcurrentUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/usrinfo")
public class UserController {

    @Autowired
    private UserServiceImpl userService;

    @GetMapping("/getuser")
    public Map getuserinfo(){
        LoginUser loginUser = SecurityUtils.getLoginUser();
        UserInfo userInfo =userService.GetUserInfo(loginUser.getUserId());
        Map map=new HashMap();
        map.put("username",userInfo.getUserName());
        map.put("nickname",userInfo.getNickName());
        map.put("deptname",userInfo.getDeptName());
        return map;
    }




}
